package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Locale;

public interface UserMapper {

    int insert(User entity);

    User selectByPrimaryKey(@Param("id") Long id);

    List<User> selectAll();

    int updateByPrimaryKey(User entity);

    User selectEmailAndPassword(@Param("email") String email, @Param("password") String password );

    String selectEmail(String email);

    List<User> selectForList(QueryObject qo);


    User checkFollow(@Param("UserId") Long UserId, @Param("theirsId") Long theirsId);

    void deleteFollow(@Param("UserId") Long UserId, @Param("theirsId") Long theirsId);

    void insertFollow(@Param("UserId") Long UserId, @Param("theirsId") Long theirsId);

    void insertFans(@Param("UserId") Long UserId, @Param("theirsId") Long theirsId);

    void deleteFans(@Param("UserId") Long UserId, @Param("theirsId") Long theirsId);

    List<Long> selectFansByUserId(Long id);

    List<Long> selectFollowByUserId(Long id);


    List<User> selectForProducts();


    /**
     * 通过朋友圈动态id查询点过赞的用户
     * @param dynamicId
     * @return
     */
    List<User> selectdoGoodCountForDynamicId(Long dynamicId);
}